<table class="table table-border table-bordered table-hover table-bg">
	<thead>
		<tr class="text-c">
			<th width="25"><input type="checkbox" value="" name=""></th>
			<th width="5%">新闻编号</th>
			<th>新闻标题</th>
			<th width="100">产品宣传</th>
			<th width="200">宣传分店</th>
			<th width="100">发布人</th>
			<th width="50">排序</th>
			<th width="150">发布时间</th>
			<th width="50">状态</th>
			<th width="70">操作</th>
		</tr>
	</thead>
	<tbody>
		<?php if(is_array($newslist) && count($newslist)){ ?>
		<?php foreach($newslist as $ls){ ?>
		<tr class="text-c" id="tr_{$ls['newid']}">
			<td><input type="checkbox" value="{$user['userid']}" name=""></td>
			<td>{$ls['newid']}</td>
			<td>{$ls['title']}</td>
			<td>{$ls['newtype'] == 1 ? '是' : '否'}</td>
			<td><?php echo empty($ls['shoptitle']) ? '---' : $ls['shoptitle']; ?></td>
			<td>{$ls['admin_nick']}</td>
			<td>{$ls['sort']}</td>
			<td>{$ls['createtime']|date="Y-m-d H:i", ###}</td>
			<td>{$ls['visible'] == 1 ? '正常' : '禁用'}</td>
			<td>
				<a href="add.html?newid={$ls['newid']}" title="编辑" style="text-decoration:none"><i class="Hui-iconfont">&#xe60c;</i></a>&nbsp;&nbsp;
				<a href="javascript:void(0);" class="dels" newid="{$ls['newid']}" title="删除" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>&nbsp;&nbsp;
			</td>
		</tr>
		<?php } }else{ ?>
		<tr class="text-c">
			<td colspan="19" >暂无数据...</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<script>
	$(document).ready(function(){
		$(".dels").on('click', function(){
			var obj = $(this);
			layer.confirm('确定删除该条资讯吗？', {
				btn: ['确定','取消'] //按钮
			}, function(){
				$.post('dels.html', {newid: obj.attr('newid')}, function(row){
					if(row/1){
						layer.msg('删除成功', {icon:1, time: 2000}, function(){
							//移除行
							$("#tr_"+ obj.attr('newid')).remove();
						});
					}else{
						layer.msg('删除失败', {icon:0, time: 2000});
					}
				});
			}, function(){
				
			});
		});
	});
</script>
<!--page-->
<include file="Common/page" />